<%@ page language="java" contentType="text/html; charset=GB18030"
    pageEncoding="GB18030"%>
<%@ page import="java.util.List" %>
<%@ page import="javax.jdo.PersistenceManager" %>
<%@ page import="com.wenjie.shoprankmonitor.User" %>
<%@ page import="com.wenjie.shoprankmonitor.PMF" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>Show DB</title>
</head>
<body>
<%
PersistenceManager pm = PMF.get().getPersistenceManager();
String query = "select from " + User.class.getName();
List<User> user = (List<User>) pm.newQuery(query).execute();
if (user.isEmpty()) {
%>
<p>The DB is empty.</p>
<%
} else {
	%><table><%
	int i = 0;
	for (User m : user) {
		%><tr><td>
		<%= ++i%>
		</td><td><%=
		m.getUser_id()
		%></td><td><%=
		m.getNickname()
		%></td><td><%=
		m.getPassword()
		%></td></tr><%
	}
	%></table><p>DB records.</p><%
}
pm.close();
%>
</body>
</html>